package com.jp.juc.taskFrame.controller;

import cn.hutool.core.collection.CollUtil;
import com.jp.juc.taskFrame.context.PendingJobPool;
import com.jp.juc.taskFrame.domain.vo.TaskResult;
import com.jp.juc.taskFrame.domain.vo.TotalProcess;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class TaskFrameController {


    PendingJobPool pendingJobPool;


    public void info(String id) {
        Map<String, Object> map = new HashMap<>();
        TotalProcess taskProcess = pendingJobPool.getTaskProcess(id);
        map.put("taskProcess", taskProcess);
        List<TaskResult<Object>> taskDetail = pendingJobPool.getTaskDetail(id);
        map.put("resultList", CollUtil.emptyIfNull(taskDetail));
    }

}
